<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>麦知网后台管理</title>

    <!-- Bootstrap core CSS -->
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/sco.message.css" rel="stylesheet">
    <link href="../css/scojs.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <style>
    /*
     * Style tweaks
     * --------------------------------------------------
     */
    html,
    body {
      overflow-x: hidden; /* Prevent scroll on narrow devices */
    }
    body {
      padding-top: 70px;
    }
    footer {
      padding: 30px 0;
    }

    /*
     * Off Canvas
     * --------------------------------------------------
     */
    @media screen and (max-width: 767px) {
      .row-offcanvas {
        position: relative;
        -webkit-transition: all 0.25s ease-out;
        -moz-transition: all 0.25s ease-out;
        transition: all 0.25s ease-out;
      }

      .row-offcanvas-right
      .sidebar-offcanvas {
        right: -50%; /* 6 columns */
      }

      .row-offcanvas-left
      .sidebar-offcanvas {
        left: -50%; /* 6 columns */
      }

      .row-offcanvas-right.active {
        right: 50%; /* 6 columns */
      }

      .row-offcanvas-left.active {
        left: 50%; /* 6 columns */
      }

      .sidebar-offcanvas {
        position: absolute;
        top: 0;
        width: 50%; /* 6 columns */
      }

    }

    .right_lit_div{
        padding:20px 10px 20px 10px;
    }
    .span2{
      font-size:15px;
      margin-left:10px;
    }
    </style>
    <script src="../js/jquery.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>
    <script src="../js/sco.message.js"></script>
    <!-- Just for debugging purposes. Don't actually copy this line! -->
    <!--[if lt IE 9]><script src="../../docs-assets/js/ie8-responsive-file-warning.js"></script><![endif]-->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="http://cdn.bootcss.com/html5shiv/3.7.0/html5shiv.min.js"></script>
      <script src="http://cdn.bootcss.com/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>
    <div class="navbar navbar-fixed-top navbar-inverse" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">麦知网后台管理</a>
        </div>
        <div class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
            <li><a href="{% url 'applications:index' %}">网站情况</a></li>
            <li><a href="{% url 'applications:groups' %}">小组管理</a></li>
            <li><a href="{% url 'applications:courses' %}">课程管理</a></li>
            <li><a href="{% url 'applications:rewards' %}">悬赏管理</a></li>
            <li><a href="{% url 'applications:users' %}">用户管理</a></li>
            <li><a href="{% url 'applications:ifgroup' %}">小组审核</a></li>
            <li class="active"><a href="#">发布者审核</a></li>
            <li><a href="{% url 'applications:invite' %}">内测—用户审核</a></li>
          </ul>
        </div><!-- /.nav-collapse -->
      </div><!-- /.container -->
    </div><!-- /.navbar -->

    <div class="container">
      <div class="row">
        <div class="col-xs-7 col-sm-7 col-md-7">
            <div style="width:100%;">
              <img src="../ID/{{the_teacher.identity_img}}" width="100%"/>
            </div>
        </div>
        <div class="col-xs-5 col-sm-5 col-md-5">
            <div>
              <div class="right_lit_div">
                <span>真实姓名</span>
                <span class="span2"><b>{{the_teacher.real_name}}</b></span>
              </div>
              <div class="right_lit_div">
                <span>身份证号</span>
                <span class="span2"><b>{{the_teacher.identity}}</b></span>
              </div>
              <div class="right_lit_div">
                <span>联系方式</span>
                <span class="span2"><b>{{the_teacher.tel}}</b></span>
              </div>
            </div>
            <div style="margin-top:30px;">
              <div class="pull-left">
                <a href="javascript:void(0)" onclick="passPublisher({{the_teacher.id}});" type="button" class="btn btn-success">审核通过</a>
              </div>
              <div class="pull-left" style="margin-left:50px;">
                <a href="javascript:void(0)" onclick="notPublisher({{the_teacher.id}});" type="button" class="btn btn-warning">驳回申请</a>
              </div>
              <div class="clearfix"></div>
            </div>
        </div>
      </div>
    </div>

      <script>
        var xmlHttp; 

        function createXMLRequest(){
          if(window.ActiveXObject){
            xmlHttp=new ActiveXObject("Microsoft.XMLHttp");
          } else if(window.XMLHttpRequest){
            xmlHttp=new XMLHttpRequest();
          }
        }


//通过发布者申请
        function passPublisher(id){   
          createXMLRequest();    
          var url='/applications/passPublisher/?tea_id='+id;
          xmlHttp.open("GET",url);
          xmlHttp.onreadystatechange=function(e){
            if(xmlHttp.readyState==4 && xmlHttp.status==200){
              if(xmlHttp.responseText=='1'){
                  e.preventDefault();
                  $.scojs_message('审核通过', $.scojs_message.TYPE_OK);
                  window.location.href="{% url 'applications:publisher' %}";
              }else{
                e.preventDefault();
                $.scojs_message('服务器出错啦～ ：）', $.scojs_message.TYPE_ERROR);
              }
            }else{
              e.preventDefault();
                $.scojs_message('服务器有小怪兽在捣乱～我们正在尽力捕捉～ ：）', $.scojs_message.TYPE_ERROR);
            }
          };
          xmlHttp.send(); 
        }
        
//驳回发布者申请
        function notPublisher(id)
        {
            createXMLRequest();    
            var url='/applications/notPublisher/?tea_id='+id;
            xmlHttp.open("GET",url);
            xmlHttp.onreadystatechange=function(e){
              if(xmlHttp.readyState==4 && xmlHttp.status==200){
                if(xmlHttp.responseText=='1'){
                    e.preventDefault();
                    $.scojs_message('审核通过', $.scojs_message.TYPE_OK);
                    window.location.href="{% url 'applications:publisher' %}";
                }else{
                  e.preventDefault();
                  $.scojs_message('服务器出错啦～ ：）', $.scojs_message.TYPE_ERROR);
                }
              }else{
                e.preventDefault();
                  $.scojs_message('服务器有小怪兽在捣乱～我们正在尽力捕捉～ ：）', $.scojs_message.TYPE_ERROR);
              }
            };
            xmlHttp.send(); 
        }
      </script>



      

    </div><!--/.container-->



    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    
    
  </body>
</html>
